package com.ll.ptgkanshuprovideruac.controller;

import com.ll.ptgkanshuprovideruac.model.domain.User;
import com.ll.ptgkanshuprovideruac.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ll
 * @date 2019年09月30日 9:32 PM
 */
@RestController
@Api(tags = "用户相关接口")
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ApiOperation("根据用户id查询用户")
    @ApiImplicitParam(name = "id", value = "用户id", required = true)
    public User getUser(@PathVariable Long id) {
        return userService.getUserById(id);
    }
}
